From: Cosimo Cecchi Date: Wed, 13 Aug 2014 22:13:20 +0000 (-0700) Subject: runDialog: catch the case where no completion is available X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2238 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=d54efe08382de35df765eb211386530a25f15e81;p=gnome-shell.git runDialog: catch the case where no completion is available Just return null, instead of failing with an exception later trying to call substr() on null. https://bugzilla.gnome.org/show_bug.cgi?id=735062 --- diff --git a/js/ui/runDialog.js b/js/ui/runDialog.js index 1d5e7a5dc..9c9ee6706 100644 --- a/js/ui/runDialog.js +++ b/js/ui/runDialog.js @@ -182,6 +182,10 @@ const RunDialog = new Lang.Class({ let results = someResults.reduce(function(a, b) { return a.concat(b); }, []); + + if (!results.length) + return null; + let common = results.reduce(_getCommon, null); return common.substr(text.length); },